/**
 * Created with IntelliJ IDEA.
 * User: wenxiwen
 * Date: 2022/3/16
 * Time: 16:15
 * Description: No Description
 */

        //滑动窗口解法

public class TestDemo {
    public static void main(String[] args) {
        int[] arr = new int[6];
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = scanner.nextInt();
        }
        System.out.println(Arrays.toString(arr));

        int left = 0;
        int right = arr.length - 1 ;
        while(left <= right) {
            int tmp = arr[left];
            arr[left] = arr[right];
            arr[right] = tmp;
            left++;
            right--;
        }

        System.out.println(Arrays.toString(arr));
    }

    public static void main(String[] args) {
        int[] ary = new int[6];
        int max;
        int min;
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i <ary.length ; i++) {
            ary[i]=scanner.nextInt();
        }

        max = ary[0];
        min = ary[0];
        for(int i = 0; i < ary.length;i++) {
            if(ary[i] > max) {
                max = ary[i];
            }
            if(ary[i] < min) {
                min = ary[i];
            }
        }


        System.out.println(max+" "+min);
    }
    public int[][] findContinuousSequence(int target) {

        int i = 1;
        int j = 1;
        int sum = 0;
        List<int[]> res = new ArrayList<>();

        while(i <= target / 2) {

            if(sum < target) {
                sum += j;
                j++;
            } else if(sum > target) {
                sum -= i;
                i++;
            } else {
                int[] arr = new int[j - i];
                for(int k = i; k < j; k++) {
                    arr[k - i] = k;
                }
                res.add(arr);
                sum -= i;
                i++;

            }
        }

        return res.toArray(new int[res.size()][]);
    }
}